$(function () {

    layui.use(['form','layer'], function(){
        $ = layui.jquery;
        var form = layui.form
            ,layer = layui.layer;

        //自定义验证规则
        form.verify({
            settleTime: function(value){
                if(value == ''){
                    return '提现次数不能为空';
                }
            }
            ,settleMoneyLimit: function(value){
                if(value == ''){
                    return '请填写提现金额上限';
                }
            }
        });

        //监听提交
        form.on('submit(add)', function(data){
            //发异步，把数据提交给php
            $.ajax({
                url:save_url,
                data:data.field,
                type:"Post",
                dataType:"json",
                success:function(data){
                    if(data.status == 1){
                        layer.msg("保存成功");
                        window.location.reload();
                    }
                },
                error:function(data){
                    layer.msg("服务器无响应");
                }
            });

            return false;
        });
    });

});